{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "在 Capital Bikeshare （美国 Washington, D.C.的一个共享单车公司）提供的自行车数据上进行回归分析。训练数据为 2011 年的数据，要求预测 2012 年每天的单车共享数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.导入必要工具包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "#导入必要的工具包\n",
    "#数据读取及基本处理\n",
    "import numpy as np \n",
    "import pandas as pd \n",
    "\n",
    "#模型\n",
    "from sklearn.linear_model import LinearRegression,RidgeCV,LassoCV,ElasticNetCV\n",
    "\n",
    "#模型评估\n",
    "from sklearn.metrics import mean_squared_error\n",
    "#评价回归预测性能\n",
    "from sklearn.metrics import r2_score\n",
    "\n",
    "\n",
    "\n",
    "import matplotlib.pyplot as plt #画图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2.数据探索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# path to where the data lies\n",
    "dpath = './';\n",
    "data = pd.read_csv(dpath + \"day.csv\");\n",
    "\n",
    "#通过观察前5行,了解数据每列(t特征)的概况\n",
    "data.head();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 731 entries, 0 to 730\n",
      "Data columns (total 16 columns):\n",
      "instant       731 non-null int64\n",
      "dteday        731 non-null object\n",
      "season        731 non-null int64\n",
      "yr            731 non-null int64\n",
      "mnth          731 non-null int64\n",
      "holiday       731 non-null int64\n",
      "weekday       731 non-null int64\n",
      "workingday    731 non-null int64\n",
      "weathersit    731 non-null int64\n",
      "temp          731 non-null float64\n",
      "atemp         731 non-null float64\n",
      "hum           731 non-null float64\n",
      "windspeed     731 non-null float64\n",
      "casual        731 non-null int64\n",
      "registered    731 non-null int64\n",
      "cnt           731 non-null int64\n",
      "dtypes: float64(4), int64(11), object(1)\n",
      "memory usage: 91.4+ KB\n"
     ]
    }
   ],
   "source": [
    "data.info();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2.2 数据基本信息\n",
    "样本数目、特征维数 每个特征的类型、空值样本的数目、数据类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.shape;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.describe();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "season属性的不同取值和出现的次数\n",
      "3    188\n",
      "2    184\n",
      "1    181\n",
      "4    178\n",
      "Name: season, dtype: int64\n",
      "\n",
      "mnth属性的不同取值和出现的次数\n",
      "12    62\n",
      "10    62\n",
      "8     62\n",
      "7     62\n",
      "5     62\n",
      "3     62\n",
      "1     62\n",
      "11    60\n",
      "9     60\n",
      "6     60\n",
      "4     60\n",
      "2     57\n",
      "Name: mnth, dtype: int64\n",
      "\n",
      "weathersit属性的不同取值和出现的次数\n",
      "1    463\n",
      "2    247\n",
      "3     21\n",
      "Name: weathersit, dtype: int64\n",
      "\n",
      "weekday属性的不同取值和出现的次数\n",
      "6    105\n",
      "1    105\n",
      "0    105\n",
      "5    104\n",
      "4    104\n",
      "3    104\n",
      "2    104\n",
      "Name: weekday, dtype: int64\n"
     ]
    }
   ],
   "source": [
    "#对类别特征，观察取值范围和直方图\n",
    "categorical_features = ['season','mnth','weathersit','weekday'];\n",
    "for col in categorical_features:\n",
    "    print '\\n%s属性的不同取值和出现的次数'%col\n",
    "    print data[col].value_counts();\n",
    "    data[col] = data[col].astype('object');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "categorical_features = ['season','mnth','weathersit','weekday'];\n",
    "x_train_cat = data[categorical_features];\n",
    "x_train_cat = pd.get_dummies(x_train_cat)\n",
    "x_train_cat.head();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#数值型变量预处理\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "mn_x = MinMaxScaler();\n",
    "numerical_features = ['temp','atemp','hum','windspeed'];\n",
    "temp = mn_x.fit_transform(data[numerical_features]);\n",
    "\n",
    "x_train_num = pd.DataFrame(data=temp, columns=numerical_features, index =data.index);\n",
    "x_train_num.head();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "x_train = pd.concat([x_train_cat, x_train_num, data['holiday'],  data['workingday']], axis = 1, ignore_index=False);\n",
    "x_train.head();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "FE_train = pd.concat([data['instant'], x_train,  data['yr'],data['cnt']], axis = 1);\n",
    "FE_train.to_csv('FE_day.csv', index=False);\n",
    "FE_train.head();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 731 entries, 0 to 730\n",
      "Data columns (total 35 columns):\n",
      "instant         731 non-null int64\n",
      "season_1        731 non-null uint8\n",
      "season_2        731 non-null uint8\n",
      "season_3        731 non-null uint8\n",
      "season_4        731 non-null uint8\n",
      "mnth_1          731 non-null uint8\n",
      "mnth_2          731 non-null uint8\n",
      "mnth_3          731 non-null uint8\n",
      "mnth_4          731 non-null uint8\n",
      "mnth_5          731 non-null uint8\n",
      "mnth_6          731 non-null uint8\n",
      "mnth_7          731 non-null uint8\n",
      "mnth_8          731 non-null uint8\n",
      "mnth_9          731 non-null uint8\n",
      "mnth_10         731 non-null uint8\n",
      "mnth_11         731 non-null uint8\n",
      "mnth_12         731 non-null uint8\n",
      "weathersit_1    731 non-null uint8\n",
      "weathersit_2    731 non-null uint8\n",
      "weathersit_3    731 non-null uint8\n",
      "weekday_0       731 non-null uint8\n",
      "weekday_1       731 non-null uint8\n",
      "weekday_2       731 non-null uint8\n",
      "weekday_3       731 non-null uint8\n",
      "weekday_4       731 non-null uint8\n",
      "weekday_5       731 non-null uint8\n",
      "weekday_6       731 non-null uint8\n",
      "temp            731 non-null float64\n",
      "atemp           731 non-null float64\n",
      "hum             731 non-null float64\n",
      "windspeed       731 non-null float64\n",
      "holiday         731 non-null int64\n",
      "workingday      731 non-null int64\n",
      "yr              731 non-null int64\n",
      "cnt             731 non-null int64\n",
      "dtypes: float64(4), int64(5), uint8(26)\n",
      "memory usage: 70.0 KB\n"
     ]
    }
   ],
   "source": [
    "FE_train.info();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2.3 数据准备\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instant</th>\n",
       "      <th>season_1</th>\n",
       "      <th>season_2</th>\n",
       "      <th>season_3</th>\n",
       "      <th>season_4</th>\n",
       "      <th>mnth_1</th>\n",
       "      <th>mnth_2</th>\n",
       "      <th>mnth_3</th>\n",
       "      <th>mnth_4</th>\n",
       "      <th>mnth_5</th>\n",
       "      <th>...</th>\n",
       "      <th>weekday_5</th>\n",
       "      <th>weekday_6</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>holiday</th>\n",
       "      <th>workingday</th>\n",
       "      <th>yr</th>\n",
       "      <th>cnt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.355170</td>\n",
       "      <td>0.373517</td>\n",
       "      <td>0.828620</td>\n",
       "      <td>0.284606</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>985</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.379232</td>\n",
       "      <td>0.360541</td>\n",
       "      <td>0.715771</td>\n",
       "      <td>0.466215</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.171000</td>\n",
       "      <td>0.144830</td>\n",
       "      <td>0.449638</td>\n",
       "      <td>0.465740</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1349</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.175530</td>\n",
       "      <td>0.174649</td>\n",
       "      <td>0.607131</td>\n",
       "      <td>0.284297</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1562</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.209120</td>\n",
       "      <td>0.197158</td>\n",
       "      <td>0.449313</td>\n",
       "      <td>0.339143</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1600</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 35 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   instant  season_1  season_2  season_3  season_4  mnth_1  mnth_2  mnth_3  \\\n",
       "0        1         1         0         0         0       1       0       0   \n",
       "1        2         1         0         0         0       1       0       0   \n",
       "2        3         1         0         0         0       1       0       0   \n",
       "3        4         1         0         0         0       1       0       0   \n",
       "4        5         1         0         0         0       1       0       0   \n",
       "\n",
       "   mnth_4  mnth_5  ...   weekday_5  weekday_6      temp     atemp       hum  \\\n",
       "0       0       0  ...           0          1  0.355170  0.373517  0.828620   \n",
       "1       0       0  ...           0          0  0.379232  0.360541  0.715771   \n",
       "2       0       0  ...           0          0  0.171000  0.144830  0.449638   \n",
       "3       0       0  ...           0          0  0.175530  0.174649  0.607131   \n",
       "4       0       0  ...           0          0  0.209120  0.197158  0.449313   \n",
       "\n",
       "   windspeed  holiday  workingday  yr   cnt  \n",
       "0   0.284606        0           0   0   985  \n",
       "1   0.466215        0           0   0   801  \n",
       "2   0.465740        0           1   0  1349  \n",
       "3   0.284297        0           1   0  1562  \n",
       "4   0.339143        0           1   0  1600  \n",
       "\n",
       "[5 rows x 35 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#读入数据\n",
    "data = pd.read_csv(\"FE_day.csv\")\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "train:(365, 33)\n",
      "test :(366, 33)\n"
     ]
    }
   ],
   "source": [
    "#读取2011年的数据作为训练数据\n",
    "train = data[data.yr ==0]\n",
    "train.drop(['instant','yr'],axis = 1,inplace = True)\n",
    "print(\"train:\" + str(train.shape))\n",
    "\n",
    "test = data[data.yr == 1]\n",
    "testID = test['instant']\n",
    "test.drop(['instant','yr'],axis = 1,inplace = True)\n",
    "print(\"test :\" + str(test.shape))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>season_1</th>\n",
       "      <th>season_2</th>\n",
       "      <th>season_3</th>\n",
       "      <th>season_4</th>\n",
       "      <th>mnth_1</th>\n",
       "      <th>mnth_2</th>\n",
       "      <th>mnth_3</th>\n",
       "      <th>mnth_4</th>\n",
       "      <th>mnth_5</th>\n",
       "      <th>mnth_6</th>\n",
       "      <th>...</th>\n",
       "      <th>weekday_4</th>\n",
       "      <th>weekday_5</th>\n",
       "      <th>weekday_6</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>holiday</th>\n",
       "      <th>workingday</th>\n",
       "      <th>cnt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.355170</td>\n",
       "      <td>0.373517</td>\n",
       "      <td>0.828620</td>\n",
       "      <td>0.284606</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>985</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.379232</td>\n",
       "      <td>0.360541</td>\n",
       "      <td>0.715771</td>\n",
       "      <td>0.466215</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.171000</td>\n",
       "      <td>0.144830</td>\n",
       "      <td>0.449638</td>\n",
       "      <td>0.465740</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1349</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.175530</td>\n",
       "      <td>0.174649</td>\n",
       "      <td>0.607131</td>\n",
       "      <td>0.284297</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1562</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.209120</td>\n",
       "      <td>0.197158</td>\n",
       "      <td>0.449313</td>\n",
       "      <td>0.339143</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1600</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 33 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   season_1  season_2  season_3  season_4  mnth_1  mnth_2  mnth_3  mnth_4  \\\n",
       "0         1         0         0         0       1       0       0       0   \n",
       "1         1         0         0         0       1       0       0       0   \n",
       "2         1         0         0         0       1       0       0       0   \n",
       "3         1         0         0         0       1       0       0       0   \n",
       "4         1         0         0         0       1       0       0       0   \n",
       "\n",
       "   mnth_5  mnth_6  ...   weekday_4  weekday_5  weekday_6      temp     atemp  \\\n",
       "0       0       0  ...           0          0          1  0.355170  0.373517   \n",
       "1       0       0  ...           0          0          0  0.379232  0.360541   \n",
       "2       0       0  ...           0          0          0  0.171000  0.144830   \n",
       "3       0       0  ...           0          0          0  0.175530  0.174649   \n",
       "4       0       0  ...           0          0          0  0.209120  0.197158   \n",
       "\n",
       "        hum  windspeed  holiday  workingday   cnt  \n",
       "0  0.828620   0.284606        0           0   985  \n",
       "1  0.715771   0.466215        0           0   801  \n",
       "2  0.449638   0.465740        0           1  1349  \n",
       "3  0.607131   0.284297        0           1  1562  \n",
       "4  0.449313   0.339143        0           1  1600  \n",
       "\n",
       "[5 rows x 33 columns]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 从原始数据中分离输入特征x和输出y\n",
    "y_train = train[\"cnt\"]\n",
    "X_train = train.drop(['cnt'],axis = 1)\n",
    "\n",
    "y_test = test['cnt'].values\n",
    "X_test = test.drop('cnt' , axis = 1)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('mean y diff :', 1.5914175510574322)\n"
     ]
    }
   ],
   "source": [
    "#数据标准化\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "# 初始化对目标值的标准化器\n",
    "mean_y = y_train.mean()\n",
    "std_y = y_train.std()\n",
    "y_train = (y_train - mean_y)/std_y\n",
    "\n",
    "y_test = (y_test - mean_y)/std_y\n",
    "\n",
    "mean_test_y = y_test.mean()\n",
    "\n",
    "mean_diff = mean_test_y\n",
    "\n",
    "print(\"mean y diff :\",mean_diff)\n",
    "\n",
    "#ss_x = StandardScaler()\n",
    "#ss_y = StandardScaler()\n",
    "\n",
    "# 分别对训练和测试数据的特征以及目标值进行标准化处理\n",
    "#x_train = ss_x.fit_transform(x_train)\n",
    "#x_test = ss_x.transform(x_test)\n",
    "\n",
    "#y_train = ss_y.fit_transform(y_train)\n",
    "#y_test = ss_y.transform(y_test)\n",
    "\n",
    "#y_train = ss_y.fit_transform(y_train.reshape(-1,1))\n",
    "#y_test = ss_y.transform(y_test.reshape(-1,1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.确定模型类型\n",
    "3.1 尝试缺省参数的线性回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('RMSE on Training set :', 0.4005371806188726)\n",
      "('RMSE on Test set :', 0.7568447350003954)\n",
      "('r2_score on Training set :', 0.8391292250928238)\n",
      "('r2_score on Test set :', 0.6587161330206196)\n"
     ]
    }
   ],
   "source": [
    "#Linear Regression\n",
    "#线性回归\n",
    "#class sklearn.linear_model.LinearRegression(fit_intercept=true,normalize=False,copy_x=True,n_jobs=1)\n",
    "\n",
    "#使用默认配置初始化\n",
    "lr = LinearRegression()\n",
    "\n",
    "# 训练模型参数\n",
    "lr.fit(X_train,y_train)\n",
    "\n",
    "#预测\n",
    "\n",
    "y_test_pred = lr.predict(X_test)\n",
    "y_train_pred = lr.predict(X_train)\n",
    "y_test_pred += mean_diff\n",
    "\n",
    "rmse_train = np.sqrt(mean_squared_error(y_train,y_train_pred))\n",
    "rmse_test = np.sqrt(mean_squared_error(y_test,y_test_pred))\n",
    "print(\"RMSE on Training set :\",rmse_train)\n",
    "print(\"RMSE on Test set :\",rmse_test)\n",
    "\n",
    "r2_score_train = r2_score(y_train,y_train_pred)\n",
    "r2_score_test = r2_score(y_test,y_test_pred)\n",
    "print(\"r2_score on Training set :\",r2_score_train)\n",
    "print(\"r2_score on Test set :\",r2_score_test)\n",
    "\n",
    "#看看各特征的权重系数，系数的绝对值大小可视为该特征的重要性\n",
    "#fs = pd.DataFrame({\"columns\":list(columns),\"coef\":list((lr.coef_.T))})\n",
    "#fs.sort_values(by=['coef'],ascending=False)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('Best alpha : ', 1.0)\n",
      "('cv of rmse : ', 0.4344609778671608)\n",
      "('RMSE on Training set :', 0.40016458243630537)\n",
      "('RMSE on Test set : ', 0.7508464827064927)\n",
      "('r2_score on Training set :', 0.8394283847299608)\n",
      "('r2_score on Test set : ', 0.664104278394783)\n"
     ]
    }
   ],
   "source": [
    "#RidgeCV缺省的score是mean squared errors\n",
    "#1.生成学习器的实例\n",
    "# RidgeCV(alphas = (0.1,1.0,10.0), fit_intercept = Trus, normalize = False,scoring = None, cv=\n",
    "#None, gcv_mode=None, store_cv_values = False)\n",
    "alphas = [0.01,0.1,1,10,100,1000]\n",
    "ridge = RidgeCV(alphas = alphas , store_cv_values = True)\n",
    "\n",
    "#2.用训练数据模型进行训练\n",
    "# RidgeCV采用的是广义交叉验证(Generalized Cross-Validation),留一交叉验证(N-折交叉验证)的一种有效实现方式\n",
    "ridge.fit(X_train,y_train)\n",
    "\n",
    "#通过交叉验证得到的最佳超参数alpha\n",
    "alpha = ridge.alpha_\n",
    "print(\"Best alpha : \", alpha)\n",
    "\n",
    "#交叉验证估计的测试误差\n",
    "mse_cv = np.mean(ridge.cv_values_,axis = 0)\n",
    "rmse_cv = np.sqrt(mse_cv)\n",
    "print(\"cv of rmse : \", min(rmse_cv))\n",
    "\n",
    "#训练上测试，训练误差\n",
    "y_train_pred = ridge.predict(X_train)\n",
    "rmse_train = np.sqrt(mean_squared_error(y_train,y_train_pred))\n",
    "\n",
    "y_test_pred = ridge.predict(X_test)\n",
    "y_test_pred += mean_diff\n",
    "rmse_test = np.sqrt(mean_squared_error(y_test,y_test_pred))\n",
    "\n",
    "print(\"RMSE on Training set :\" ,rmse_train)\n",
    "print(\"RMSE on Test set : \", rmse_test)\n",
    "\n",
    "r2_score_train = r2_score(y_train,y_train_pred)\n",
    "r2_score_test = r2_score(y_test,y_test_pred)\n",
    "\n",
    "print(\"r2_score on Training set :\", r2_score_train)\n",
    "print(\"r2_score on Test set : \", r2_score_test)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ridge picked32 features and eliminated the other0 features\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAacAAAEICAYAAAD7pTujAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xu8VVW5//HPN++KSQWZpkiiHlJQFMQ8auEl7ahpF82USqwsNfP083g75lFOZlnYKc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eT9BnSmm4fqmM8b12uTNlbceU/dL5P+rlupEo+r7VJQ3ujSL3MaZKGREqM3cy4jgSuiojvSdqdtNTQkDr9rPeYG6cWFhH7dbZP0nOSNouIZ/Mv03JDBouB2RHxZD7mFuADrGbjVIO4dgf2knQC6T7YupJejYhOb3Y3KC4kvR2YAJwVEfetTjxdWAxsWfR6C1YdWinUWSxpbdLwy1+on0piQtJ+pMb+QxGxrHR/E+LaGBgCTMl/6LwHuFXSIRExq4lxFercFxFvAgslPUpqrGZSP5XE9QXgIwARMUNp/b1+dPJ/olk8rNe+biWtPEz+9//K1JkJvENS4b7JPsDvmx1XRIyOiAERMZC0Ttg1q9sw1SIuSesCN+d4bqhjLDOBbSW9L1/z0zm+zuI9DLg78h3sZsWUh89+ChzSoPsn3cYVES9HRL+IGJh/nu7L8dWzYeo2ruwW0iQSJPUjDfM92QJx/RHYN8f1ftL6e0vqHFf1mj0jw189+yLdf5gMPJ7/fWcuHwFcXlTvw6TViztIa2mt2wpxFdUfQ2Nm63UbF/AZ4E3SQpqFr2F1iudA4DHSPa2v57JvkH6xQvqFcQPwB+ABYOsGfEbdxfQb4Lmiz+bWesdUSVwldafQgNl6FX5eAv6H9AdhB/DpFolre2A6aSbfHGD/RsRV7ZfTF5mZWcvxsJ6ZmbUcN05mZtZy3DiZmVnLceNkZmYtx42TmZm1HDdOZmbWctw4mZlZy/n/ueoJLPvIXj4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xt4VfWd7/H3NyEJ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romMH2JmRZHx75nZVTHjfxnJIBIolYKkoltovC79aBovGfBDM+sXeX4IcAkwg8YzwI+bAKyKmX50YNH2AAAB50lEQVTU3QuAS4FrzezSJtaTDbzn7uOAPwPfi5nXyd0LgW/GPL8buDEy/g7gv2LGFwPXtP6tirROUl4QT6QZVwMvR648ucvM/gxcHnn+FXdvAHaa2Vsxr+kHVMRM325mM2n8N9SPxpv6fBC3ngbg55HHLwKxF287/ngVjUUEjdfJf8LMxgD1wPCY8buB/q18nyKtplKQVNTUJbZP9zxAFdAZwMyGAt8GLnf3/WY29/i8ZsReU6Y68mc9J/4d/h2wi8Y9mDTgWMz4zpEMIoHS4SNJRe8Ad0RuXJIH/AWwAlgM3Br5bOFc4LqY12wALog87g4cBQ5Gxt10ivWkAcc/k7grsvzT6QHsiOyp3Aukx8wbTkCXShaJpT0FSUWv0/h5wRoaf3v/R3ffaWavAtfTuPH9mMY7eh2MvOa3NJbEm+6+xszeB9YBJcCSU6znKHCxma2KLOeOZnL9BHjVzG4D3oq8/rjPRTKIBEpXSRWJYWbd3P2ImfWhce9hQqQwutC4oZ4Q+SyiJcs64u7d2ijXO8Bkd9/fFssTORXtKYh81m8iNzTJBL7v7jsB3L3KzL5H4z2ftyYyUOQQ149UCJII2lMQEZEofdAsIiJRKgUREYlSKYiISJRKQUREolQKIiISpVIQEZGo/w/UlUJflLRwqQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot important coefficients\n",
    "coefs = pd.Series(ridge.coef_,index = X_train.columns)\n",
    "print(\"Ridge picked\" + str(sum(coefs != 0)) + \" features and eliminated the other\" + str(sum(coefs == 0)) + \" features\") \n",
    "\n",
    "\n",
    "#正系数值最大的10个特征和负系数值最小(绝对值大)的10个特征\n",
    "imp_coefs = pd.concat([coefs.sort_values().head(10),coefs.sort_values().tail(10)])\n",
    "\n",
    "imp_coefs.plot(kind = \"barh\")\n",
    "plt.title(\"Coefficients in the Ridge Model\")\n",
    "plt.show()\n",
    "\n",
    "mse_mean = np.mean(ridge.cv_values_, axis = 0)\n",
    "plt.plot(np.log10(alphas),mse_mean.reshape(len(alphas),1))\n",
    "\n",
    "plt.xlabel('log(alpha)')\n",
    "plt.ylabel('mse')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('Best alpha : ', 0.0005827919419717718)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xl8VfWd//HXJwkhEMKasC9hX0RAiKCiiEtbXKrVWpfaat3ozHRs++u01dZWp+3MdGqnrdNFLe0oda/jVqwLblVcihp2ArJvIQTClpCQPZ/fH/eSiZiEG8jJuTd5Px+PPHKX773n8+WGvHO+33O+x9wdERERgKSwCxARkfihUBARkXoKBRERqadQEBGRegoFERGpp1AQEZF6CgUREamnUBARkXoKBRERqZcSdgEtlZmZ6dnZ2WGXISKSUJYsWbLX3bOO1S7hQiE7O5vc3NywyxARSShmti2Wdho+EhGRegoFERGpp1AQEZF6CgUREamnUBARkXoKBRERqadQEBGRegoFEZEEcM9r61m6/UDg20m4k9dERDqaD7fu557XNgAwdWivQLelPQURkThWV+f8+Pk1DOiRxldnjQx8ewoFEZE49syynazaWcxtc8bRJTU58O0pFERE4lRZZQ13v/wRU4b05JLJA9tkm4GFgpk9YGZ7zGx1M21mm9lyM8szs7eCqkVEJBHd9+Ym9hyq5M7PTiApydpkm0HuKcwH5jT1pJn1BO4FLnH3k4AvBFiLiEhC2b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3H2FmS0jskroZuDdJrZTBpxkZkui73PVMeq6F3jazL4A/C36+iPOidYgEiitkirSgJl1c/dSM+tDZO9hZjQwuhD5RT0zOhcRy3uVunu3VqprEXCpR667LRIY7SmIfNxfzawnkAr8xN0LAdy93MzuInIN3+1tWVB0iOuXCgRpC9pTEBGReppoFhGRegoFERGpp1AQEZF6CgUREamnUBARkXoKBRERqff/Ae8i3+ekRXE2AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('cv of rmse : ', 0.6611882945783697)\n",
      "Lasso picked 26 feayures and eliminated the other 6features\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAacAAAEICAYAAAD7pTujAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XucXfO9//HXu25BlCJVqUsqoSlCNCFVtAkOLepS/BRHRfWirTo9bZFDq2lxqo1WXauoe44qpcetQqMkIoKQZKTuxElKCa2gSJHP74/vd8vOzsyePXv27L1nz/v5eMxj9qz1XWt9197JfOf7Xd/1XooIzMzMmsn7Gl0BMzOzUm6czMys6bhxMjOzpuPGyczMmo4bJzMzazpunMzMrOm4cbJeSdJHJT0k6TVJx0haVdKNkhZJukbSoZJuq2A/J0i6qB51LlOHjSS9LmmFGu1vvKQra7GvvkbSPEm7Nroe5sbJepikQyQ9kH/5Pi/pj5J2rMGujwPujIg1IuIs4ABgPWCdiDgwIiZGxG6d7SQi/jsivtzdykgaJCkkrdjVbSPi/yKif0S8W8VxR0ta0NXturD/SyWd0lP7r1auV0jau2T5L/PysXWowwWSHpO0pB7H62vcOFmPkfQd4JfAf5Majo2A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kVaNr/W90REa8Wvb5F0nmS1o2IVgmEXYaH9RrnfmBTSR+RtDLwBaBpZ7UVuYH0xGPy9+V6iZI+IGmV/Hpd0vOx/lK3Glauks+g+HwPAO6I3nHneqfnVnIdZm/gkTrWryfdAHwxz9r7BLCoMBTdm0n6UNHz7bYj/f5+ufxWvVhE+KvGX8B+pL/eFgMvAJPy8oHALUXl9gAeJ/UoTmx0vSs8t3VIs/SeyN/XzstHAhfl158kPctrdv5+ZKPrXeZ8lvsMgB8De+fX/YBrgCeB+4BNGl3nGp7bT4C5+XP6M+lZbA2vdwXndRXwPPB2/n92JOkBqEfl9SLNVHwq//sb2eg61+i8ji76vO4FPtnoOvfkl+OLzMys6XhYz8zMmo4bJzMzazpunMzMrOm4cTIzs6bjxsnMzJqOGyczM2s6bpzMzKzp/H8j3fB9xuPVXAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xl8VfWd//HXJwkhEMKasC9hX0RAiKCiiEtbXKrVWpfaat3ozHRs++u01dZWp+3MdGqnrdNFLe0oda/jVqwLblVcihp2ArJvIQTClpCQPZ/fH/eSiZiEG8jJuTd5Px+PPHKX773n8+WGvHO+33O+x9wdERERgKSwCxARkfihUBARkXoKBRERqadQEBGRegoFERGpp1AQEZF6CgUREamnUBARkXoKBRERqZcSdgEtlZmZ6dnZ2WGXISKSUJYsWbLX3bOO1S7hQiE7O5vc3NywyxARSShmti2Wdho+EhGRegoFERGpp1AQEZF6CgUREamnUBARkXoKBRERqadQEBGReg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GkQCpVCQjqixJZObexygHEgDMLPhwLeBU939gJnNP/LcMTRcU6Yy+r2W//t/+P+IrNMzmchefEWD9mnRGkQCpeEj6YgWAVeZWXJ0nH8W8AHwDvD56NxCPz6+BPlaYFT0dnegDCiOtrugie0kAUfmJL4Yff/m9AB2RfdUvkzkcpFHjCFxVyOVBKI9BemIniUyX7CCyF/v33X3QjN7GjiPyC/f9cD7QHH0NS8QCYnX3H2FmS0jskroZuDdJrZTBpxkZkui73PVMeq6F3jazL4A/C36+iPOidYgEiitkirSgJl1c/dSM+tDZO9hZjQwuhD5RT0zOhcRy3uVunu3VqprEXCpR667LRIY7SmIfNxfzawnkAr8xN0LAdy93MzuInIN3+1tWVB0iOuXCgRpC9pTEBGReppoFhGRegoFERGpp1AQEZF6CgUREamnUBARkXoKBRERqff/Ae8i3+ekRXE2AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('RMSE on Training set : ', 0.3987718352033183)\n",
      "('RMSE on Test set : ', 0.748177853215867)\n",
      "('r2_score on Training set :', 0.8405441581283813)\n",
      "('r2_score on Test set : ', 0.6664876904699156)\n"
     ]
    }
   ],
   "source": [
    "# 3 Lasso\n",
    "lasso = LassoCV()\n",
    "lasso.fit(X_train , y_train)\n",
    "alpha = lasso.alpha_\n",
    "\n",
    "print(\"Best alpha : \" , alpha)\n",
    "\n",
    "mses = np.mean(lasso.mse_path_,axis = 1)\n",
    "plt.plot(np.log10(lasso.alphas_) , mses)\n",
    "#plt.plot(np.log10(lasso.alphas) * np.ones(3) , [0.3,0.4,1.0])\n",
    "plt.xlabel('log(alpha)')\n",
    "plt.ylabel('mse')\n",
    "plt.show()\n",
    "\n",
    "mse_cv = np.mean(lasso.mse_path_, axis = 1)\n",
    "rmse_cv = np.sqrt(mse_cv)\n",
    "print(\"cv of rmse : \" , min(rmse_cv))\n",
    "\n",
    "#Plot important coefficients\n",
    "\n",
    "coefs = pd.Series(lasso.coef_ , index = X_train.columns)\n",
    "print(\"Lasso picked \" + str(sum(coefs != 0)) + \" feayures and eliminated the other \" + str(sum(coefs == 0 )) + \"features\")\n",
    "\n",
    "imp_coefs = pd.concat([coefs.sort_values().head(10),coefs.sort_values().tail(10)])\n",
    "imp_coefs.plot(kind = \"barh\")\n",
    "plt.title(\"Coefficients in the Lasso Mode1\")\n",
    "plt.show()\n",
    "\n",
    "mses = np.mean(lasso.mse_path_ , axis = 1)\n",
    "plt.plot(np.log10(lasso.alphas_) , mses)\n",
    "#plt.plot(np.log10(lasso.alphas) * np.ones(3) , [0.3,0.4,1.0])\n",
    "plt.xlabel('log(alpha)')\n",
    "plt.ylabel('mse')\n",
    "plt.show()\n",
    "\n",
    "y_train_pred = lasso.predict(X_train)\n",
    "rmse_train = np.sqrt(mean_squared_error(y_train,y_train_pred))\n",
    "print(\"RMSE on Training set : \" , rmse_train)\n",
    "\n",
    "y_test_pred = lasso.predict(X_test)\n",
    "y_test_pred += mean_diff\n",
    "\n",
    "rmse_test = np.sqrt(mean_squared_error(y_test,y_test_pred))\n",
    "print(\"RMSE on Test set : \" , rmse_test)\n",
    "\n",
    "r2_score_train = r2_score(y_train , y_train_pred)\n",
    "r2_score_test = r2_score(y_test , y_test_pred)\n",
    "print(\"r2_score on Training set :\" , r2_score_train)\n",
    "print(\"r2_score on Test set : \" , r2_score_test)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_test_pred = lasso.predict(X_test)\n",
    "y_test_pred += mean_diff\n",
    "y_test_pred = y_test_pred * std_y + mean_y\n",
    "\n",
    "#生成提交测试结果\n",
    "\n",
    "df = pd.DataFrame({\"instant\" : testID , 'cnt' : y_test_pred})\n",
    "\n",
    "df.to_csv('submission.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 366 entries, 365 to 730\n",
      "Data columns (total 2 columns):\n",
      "cnt        366 non-null float64\n",
      "instant    366 non-null int64\n",
      "dtypes: float64(1), int64(1)\n",
      "memory usage: 8.6 KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
